<?php
namespace app\common\controller;
use think\Container;
use app\common\model\Operation;
use think\facade\Request;

class Manage extends Base
{
    protected $sellerId = 0;

    protected function initialize()
    {
        parent::initialize();
        //没有登陆，请先登录
        if(!session('?manage'))
        {
            cookie('redirect_url', Container::get('request')->url(), 3600);
            $this->redirect('manage/common/login');
        }

        $cont_name = Request::controller();
        $act_name = Request::action();

        $operationModel = new Operation();
        //取菜单导航信息
        $this->assign('nav', $operationModel->nav($operationModel::MENU_MANAGE, $cont_name, $act_name));
        $this->assign('menu',$operationModel->manageMenu(session('manage')['id'], $cont_name, $act_name));

        $jhCmsHost = Container::get('request')->domain();
        $this->assign('jhcmsHost', $jhCmsHost);
    }
}